10. Quiz: Tuples

Tuples

QUIZ QUESTION::

Match the following qualities to their data structure.

ANSWER CHOICES:



Data Structure

Quality

immutable

immutable

unordered

mutable

ordered

ordered

SOLUTION:

Data Structure

Quality

immutable

immutable

mutable

ordered

ordered

ordered

ordered

Tuples

What would the output of the following code be? (Treat the comma in the multiple choice answers as newlines.)

tuple_a = 1, 2
tuple_b = (1, 2)

print(tuple_a == tuple_b)
print(tuple_a[1])
SOLUTION: True, 2

Tuples Playground

Start Quiz:

## You may test any code out here. Use Test Run to see your output